package crm.model.teacherPC.statistic;

public class StatisticValue implements Comparable {
	private long time;
	private String name;
	private final Statistic statistic;
	public StatisticValue(long time, String name, Statistic statistic) {
		this.time = time;
		this.name = name;
		this.statistic=statistic;
	}



	public long getTime() {
		return time;
	}

	public void setTime(int time) {
		this.time = time;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void addTime(long time){
		this.time += time;
	}
	public Statistic getStatistic() {
		return statistic;
	}


	@Override
	public int compareTo(Object obj) {
		StatisticValue val = (StatisticValue)obj;
		if (time > val.time){
			return 1;
		}else if (time < val.time){
			return -1;
		}else {
			return 0;
		}
	}
	
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return name;
	}
}
